package my.springboot;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

@Component
public class Config {
	/**
	 * 注入环境变量
	 */
	@Autowired  
	private Environment env;

	
	public Config() {
		/**
		 * 获取环境变量中的配置
		 */
		String instanceName = this.env.getProperty("INSTANCE_NAME");
		String domainPort = this.env.getProperty("DOMAIN_PORT");
	}
	
}
